Socket
Socket
Sign inDemoInstall

@webpack-cli/serve

Package Overview
Dependencies
120
Maintainers
3
Versions
37
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @webpack-cli/serve

[![NPM Downloads][downloads]][downloads-url]


Version published
Maintainers
3
Install size
17.0 kB
Created

Package description

What is @webpack-cli/serve?

The @webpack-cli/serve package is a command line interface tool that allows you to quickly serve your webpack projects. This package integrates with webpack-dev-server to provide a development server with live reloading and custom server configurations, enhancing the development experience by enabling hot module replacement and efficient development workflows.

What are @webpack-cli/serve's main functionalities?

Starting a development server

This command starts a development server using the configuration specified in 'webpack.config.js'. It automatically compiles your app as you make changes to the files, providing a live development environment.

npx webpack serve --config webpack.config.js

Custom server configuration

This code snippet shows how to customize the webpack development server by setting a specific port, automatically opening the browser after server starts, and setting up a proxy for API requests.

module.exports = {
  devServer: {
    port: 8080,
    open: true,
    proxy: {
      '/api': 'http://localhost:3000'
    }
  }
};

Enabling Hot Module Replacement (HMR)

This configuration enables Hot Module Replacement (HMR), which allows modules to be updated in the browser without requiring a full refresh, maintaining the state of the application.

module.exports = {
  devServer: {
    hot: true
  }
};

Other packages similar to @webpack-cli/serve

Readme

Source

webpack-cli serve

NPM Downloads

This package is used by webpack-cli under-the-hood and is not intended for installation as of v0.2.0

Description

This package contains the logic to run webpack-dev-server to serve your webpack app and provide live reloading.

Installation

npm i -D webpack-cli @webpack-cli/serve

Usage

CLI (via webpack-cli)

npx webpack-cli serve

Options

Checkout SERVE-OPTIONS-v3.md or SERVE-OPTIONS-v4.md to see list of all available options for serve command for respective webpack-dev-server version.

FAQs

Last updated on 13 Jun 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc